package cn.edu.scau.cmi.wujingxuan.Factory.SimpleFactory;

public class Producer
{
	public static AutoInsurance getPolicyObj(String option)
	{
		AutoInsurance policy = null;
		if (option.compareTo("bodyinjury") == 0)
		{
			policy = new BodyInjury();
		} else if (option.compareTo("cardamage") == 0)
		{
			policy = new CarDamage();
		} else if (option.compareTo("casualty") == 0)
		{
			policy = new Casualty();
		} else if (option.compareTo("accident") == 0)
		{
			policy = new Accident();
		}
		return policy;
	}
}
